////
////  MTClubViewController.swift
////  MT
////
////  Created by ooops on 2020/5/7.
////  Copyright © 2020 张强. All rights reserved.
////
//
//
//import UIKit
//import YPNavigationBarTransition
//import MTCategory
//import JXPagingView
//import JXCategoryView
//import DeviceKit
//
//class MTClubViewController: BaseViewController {
//    
////    lazy var rightBtn: UIButton = {
////        let btn: UIButton = UIButton(type: .custom)
////        btn.setTitle("广场", for: .normal)
////        btn.setTitleColor(UIColor.white, for: .normal)
////        btn.titleLabel?.font = PingFangSCMediumFont(16)
////        btn.addTarget(self, action: #selector(jump), for: .touchUpInside)
////        btn.setImage(UIImage(named: "icon_arrow_right"), for: .normal)
////        //btn.frame = CGRect(x: 0, y: 0, width: 40, height: 20)
////        btn.sizeToFit()
////        btn.adjustImage(position: .right, spacing: 1)
////        return btn
////    }()
//    
//    lazy var rightBtn: UIButton = {
//        let btn: UIButton = UIButton(type: .custom)
//        btn.setImage(UIImage(named: "icon-addfriend"), for: .normal)
//        btn.addTarget(self, action: #selector(_clickNavRightButton(_:)), for: .touchUpInside)
//        //btn.frame = CGRect(x: 0, y: 0, width: 40, height: 20)
//        btn.sizeToFit()
//        btn.adjustImage(position: .right, spacing: 1)
//        return btn
//    }()
//    
////    private lazy var indicatoryView: JXCategoryIndicatorBackgroundView = {
////        let indicatory: JXCategoryIndicatorBackgroundView = JXCategoryIndicatorBackgroundView()
//////        indicatory.indicatorColor = MainYellowColor
//////        indicatory.indicatorColor = MainYellowColor
////        indicatory.indicatorHeight = NavigationBarHeight
////        indicatory.indicatorCornerRadius = 0
////        indicatory.indicatorWidth = 105
//////        indicatory.indicatorWidthIncrement = -5
////        return indicatory
////    }()
//    
//    lazy var indicatorLineView: JXCategoryIndicatorLineView = {
//        let l: JXCategoryIndicatorLineView = JXCategoryIndicatorLineView()
//        l.indicatorColor = UIColor.text.x1d1a1a
//        l.indicatorCornerRadius = 2
//        l.indicatorWidth = 20
//        l.indicatorHeight = 3
//        return l
//    }()
//    
//    private var titles: [String] = ["我的俱乐部", "俱乐部大厅"]
//    
//    lazy var navCategoryView: JXCategoryTitleView = {
//        let titleView: JXCategoryTitleView = JXCategoryTitleView(frame: CGRect(x: (ScreenWidth - 210) / 2, y: 5, width: 210, height: NavigationBarHeight - 10))
//        titleView.titles = self.titles
//        titleView.indicators = [indicatorLineView]
//        titleView.titleSelectedFont = PingFangSCSemiboldFont(18)
//        titleView.titleSelectedColor = UIColor.text.x1d1a1a
//        titleView.titleFont = PingFangSCSemiboldFont(16)
//        titleView.titleColor = UIColor.text.x9b9b9b
//        titleView.isTitleColorGradientEnabled = true
//        titleView.cellWidth = 80
//        titleView.cellSpacing = 0
////        titleView.isAverageCellSpacingEnabled = false
////        titleView.layer.borderColor = UIColor(hex: 0x3E3E3E).cgColor
////        titleView.layer.borderWidth = 0.5
////        titleView.layer.cornerRadius = 2
////        titleView.clipsToBounds = true
//        return titleView
//    }()
//    
//    lazy var pagerView: JXPagingView = {
//        let pager: JXPagingView = JXPagingView(delegate: self)
//        pager.mainTableView.backgroundColor = UIColor(hex: 0xFFFFFF)
//        pager.isListHorizontalScrollEnabled = false
////        pager.listContainerView.collectionView.bounces = false
//        return pager
//    }()
//    
//    func _getChatRoomList(complete: @escaping ([JMSGChatRoom]?) -> Void ) {
//        JMSGChatRoom.getListWithAppKey(nil, start: 0, count: 1) { (result, error) in
//            if error != nil {
//                complete(nil)
//                return
//            }
//            DispatchQueue.main.async {
//                if let rooms = result as? [JMSGChatRoom] {
//                    complete(rooms)
//                } else {
//                    complete(nil)
//                }
//            }
//        }
//    }
//    
//    override func viewDidLoad() {
//        super.viewDidLoad()
//        //edgesForExtendedLayout = .all
//        //automaticallyAdjustsScrollViewInsets = true
////        self.navigationController?.navigationBar.isTranslucent = false
//        //addButton.addTarget(self, action: #selector(_clickNavRightButton(_:)), for: .touchUpInside)
//        //addButton.setImage(UIImage.loadImage("com_icon_friend_add"), for: .normal)
//        let item = UIBarButtonItem(customView: rightBtn)
////         self.navigationItem.rightBarButtonItems = [item, UIBarButtonItem(customView: rightBtn)]
//        self.navigationItem.rightBarButtonItems = [item]
//        self.navigationItem.titleView = self.navCategoryView
//        
//        view.addSubview(self.pagerView)
//        
//        //addEnviromentButton()
//        
//        self.pagerView.snp.makeConstraints {
//            $0.edges.equalToSuperview()
//        }
//        
//        //self.navCategoryView.contentScrollView = self.pagerView.listContainerView.collectionView
//        pagerView.mainTableView.gestureDelegate = self
//        //扣边返回处理，下面的代码要加上
//        //pagerView.listContainerView.collectionView.panGestureRecognizer.require(toFail: self.navigationController!.interactivePopGestureRecognizer!)
//        pagerView.mainTableView.panGestureRecognizer.require(toFail: self.navigationController!.interactivePopGestureRecognizer!)
////        if #available(iOS 11.0, *) {
////            self.pagerView.mainTableView.contentInsetAdjustmentBehavior = .never
////        } else {
////            self.automaticallyAdjustsScrollViewInsets = false
////        }
//    }
//    
//    
//    //MARK: - click func
//    @objc func _clickNavRightButton(_ sender: UIButton) {
//        //navigationController?.pushViewController(JCSearchFriendViewController(), animated: true)
//        let c: MTSearchAddFriendViewController = MTSearchAddFriendViewController()
//        let n: BaseNavController = BaseNavController(rootViewController: c)
//        n.modalPresentationStyle = .fullScreen
//        n.modalTransitionStyle = .crossDissolve
//        navigationController?.present(n, animated: true, completion: nil)
//        //navigationController?.pushViewController(MTSearchAddFriendViewController(), animated: true)
//    }
//}
//
//
//// MARK: - JXPagingViewDelegate
////extension MTClubViewController: JXPagingViewDelegate {
////    func tableHeaderViewHeight(in pagingView: JXPagingView) -> Int {
////        return 0
////    }
////
////    func tableHeaderView(in pagingView: JXPagingView) -> UIView {
////        return UIView()
////    }
////
////    func heightForPinSectionHeader(in pagingView: JXPagingView) -> Int {
////        return 0
////    }
////
////    func viewForPinSectionHeader(in pagingView: JXPagingView) -> UIView {
////        return self.navCategoryView
////    }
////
////    func numberOfLists(in pagingView: JXPagingView) -> Int {
////        return self.titles.count
////    }
////
////
////
////    func pagingView(_ pagingView: JXPagingView, initListAtIndex index: Int) -> JXPagingViewListViewDelegate {
//////        if index == 0 {
////            let s: MTMineClubViewController = MTMineClubViewController()
////
////            return s
//////        }
//////        else {
//////            //let s: FriendListViewController = FriendListViewController()
//////            let s: MTClubCollectionViewController = MTClubCollectionViewController()
//////
//////            return s
//////        }
////    }
////}
//
//extension MTClubViewController: JXPagingMainTableViewGestureDelegate {
//    func mainTableViewGestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
//        //禁止segmentedView左右滑动的时候，上下和左右都可以滚动
//        if otherGestureRecognizer.view?.isKind(of: UITableView.self) == true {
//            return false
//        }
////        if otherGestureRecognizer == pagerView.listContainerView.collectionView.panGestureRecognizer {
////            return true
////        }
//        return gestureRecognizer.isKind(of: UIPanGestureRecognizer.classForCoder()) && otherGestureRecognizer.isKind(of: UIPanGestureRecognizer.classForCoder())
//    }
//}
//
//
//extension MTClubViewController {
//    
//    override func yp_navigtionBarConfiguration() -> YPNavigationBarConfigurations {
//        return [.backgroundStyleColor, .backgroundStyleOpaque, .showShadowImage]
//    }
//}
